﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EditOrder.aspx.cs" Inherits="MyShop.EditOrder" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:Panel ID="OrdersPrice" runat="server" >
         <a  runat="server" href="~/Admin.aspx?" style=""> Go Back</a> 
        <div  style="margin:20px;border: 1px solid #808080;padding:5px;"> Order Price:
             <asp:GridView ID="GridViewOrder" runat="server" AllowPaging="True" AllowSorting="False" DataKeyNames="Id" 
                  AutoGenerateColumns="False" BackColor="White" BorderColor="#DEDFDE" OnRowDataBound="GridViewOrder_RowDataBound" 
                  BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Vertical" >
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <%--<asp:CommandField ShowSelectButton="True" />--%>
               <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" ReadOnly="True" SortExpression="Id" />
                <asp:BoundField DataField="FirstName" ReadOnly="True" HeaderText="FirstName" SortExpression="FirstName" />
                <asp:BoundField DataField="LastName" ReadOnly="True" HeaderText="LastName" SortExpression="LastName" />
                <asp:BoundField DataField="Email" ReadOnly="True" HeaderText="Email" SortExpression="Email" />
                <asp:BoundField DataField="Phone" ReadOnly="True" HeaderText="Phone" SortExpression="Phone" />
                <asp:BoundField DataField="Delivery" ReadOnly="True" HeaderText="Delivery" SortExpression="Delivery" />
                <asp:BoundField DataField="DateOrder" ReadOnly="True" HeaderText="DateOrder" SortExpression="DateOrder" />
                <asp:TemplateField HeaderText="StatusOrder" SortExpression="StatusOrder">
                    <ItemTemplate>
                    <asp:DropDownList 
                        ID="StatusDropDownList"

                        AutoPostBack="true" 
                        OnSelectedIndexChanged="ddlTest_SelectedIndexChanged"
                        runat="server" Width="100px">
                      <%--  <asp:ListItem Value=""></asp:ListItem>--%>
                    </asp:DropDownList>
                         <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:ShopConnectionString %>" SelectCommand="SELECT * FROM [OrderedStatus]"></asp:SqlDataSource>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:Button ID="Button1" runat="server" Text="Open"  CommandArgument='<%# Eval("ID") %>' OnClick="AllInfo_Click"/>
                       <%-- <asp:Button ID="ButtonPrint" runat="server" Text="Print"  CommandArgument='<%# Eval("ID") %>' OnClick="ButtonPrint_OnClick"/>--%>
                    </ItemTemplate>
                </asp:TemplateField>
                <%--<asp:TemplateField>
                    <ItemTemplate>
                        
                    </ItemTemplate>
                </asp:TemplateField>--%>

                <asp:BoundField DataField="Status" HeaderText="StatusOrder" SortExpression="StatusOrder" Visible="False"/>
                <%--<asp:CommandField ShowDeleteButton="True" ShowEditButton="True"/>--%>
            </Columns>
            <FooterStyle BackColor="#CCCC99" />
             
            <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
            <RowStyle BackColor="#F7F7DE" />
            <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#FBFBF2" />
            <SortedAscendingHeaderStyle BackColor="#848384" />
            <SortedDescendingCellStyle BackColor="#EAEAD3" />
            <SortedDescendingHeaderStyle BackColor="#575357" />
        </asp:GridView>
            

            <div style="height: 20px;"></div>
            

            <asp:GridView ID="GridViewInfoOrder" runat="server" AllowPaging="True" AllowSorting="False" DataKeyNames="OrderID" 
                  AutoGenerateColumns="False" BackColor="White" BorderColor="#DEDFDE"
                  BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Vertical">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <%--<asp:CommandField ShowSelectButton="True" />--%>
               <asp:BoundField DataField="OrderID" HeaderText="Id" InsertVisible="False" ReadOnly="True" SortExpression="OrderID" />
                <asp:BoundField DataField="NameProduct" ReadOnly="True" HeaderText="Name Product" SortExpression="NameProduct" />
                <asp:BoundField DataField="Count" ReadOnly="True" HeaderText="Count" SortExpression="Count" />
                <asp:BoundField DataField="NeedCount" ReadOnly="True" HeaderText="Need Count" SortExpression="NeedCount" />
                <asp:BoundField DataField="Price" ReadOnly="True" HeaderText="Price" SortExpression="Price" />
                
            </Columns>
            <FooterStyle BackColor="#CCCC99" />
            <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
            <RowStyle BackColor="#F7F7DE" />
            <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#FBFBF2" />
            <SortedAscendingHeaderStyle BackColor="#848384" />
            <SortedDescendingCellStyle BackColor="#EAEAD3" />
            <SortedDescendingHeaderStyle BackColor="#575357" />
        </asp:GridView>

         <asp:Button ID="ButtonPrint" runat="server" Text="Print"  CommandArgument='<%# Eval("ID") %>' OnClick="ButtonPrint_OnClick"/>  

        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ShopConnectionString %>" 
            UpdateCommand="Update OrderedUsers SET StatusOrder=@StatusOrder WHERE Id=@Id"
            DeleteCommand="DELETE FROM OrderedUsers WHERE Id=@Id;"  
            SelectCommand="SELECT * FROM [OrderedUsers]"></asp:SqlDataSource>
        </div>
    </asp:Panel>
    </div>
    </form>
</body>
</html>
